package net.cathackers.devel.scmp.chat.impl.xmpp.iqcomponent.roster;

import net.cathackers.devel.scmp.auth.interfaces.UserID;
import net.cathackers.devel.scmp.chat.interfaces.RosterSubscriptionManager.Ask;
import net.cathackers.devel.scmp.chat.interfaces.RosterSubscriptionManager.Subscription;

public class RosterItem {

    private UserID jid_;
    private String group_;
    private String nickname_;
    private Subscription subscription_;
    private Ask ask_;
    private Long rosterItemID_;

    public RosterItem(Long rosterItemID, UserID JID, Ask ask, Subscription sub,
	    String group, String nickName) {
	this.rosterItemID_ = rosterItemID;
	this.jid_ = JID;
	this.ask_ = ask;
	this.subscription_ = sub;
	this.nickname_ = nickName;
	this.group_ = group;
    }

    public RosterItem(UserID JID, String nickName, Ask ask, Subscription sub,
	    String group) {
	this.jid_ = JID;
	this.nickname_ = nickName;
	this.ask_ = ask;
	this.subscription_ = sub;
	this.group_ = group;
    }

    public static Ask getAskType(String type) {
	Ask ret = Ask.NONE ;
	for (Ask askType : Ask.values()) {
	    if (askType.toString().equals(type)) {
		ret = askType;
	    }
	}
	return ret;
    }

    public static Subscription getSubType(String type) {
	Subscription ret = Subscription.NONE;
	for (Subscription subType : Subscription.values()) {
	    if (subType.toString().equals(type)) {
		ret = subType;
	    }

	}
	return ret;
    }

    public void setAsk(Ask ask) {
	ask_ = ask;
    }

    public Ask getAsk() {
	return ask_;
    }

    public void setSubscription(Subscription subscription) {
	subscription_ = subscription;
    }

    public Subscription getSubscription() {
	return subscription_;
    }

    public void setNickname(String nickname) {
	nickname_ = nickname;
    }

    public String getNickname() {
	return nickname_;
    }

    public void setGroup(String group) {
	group_ = group;
    }

    public String getGroup() {
	return group_;
    }

    public Long getRosterItemID() {
	return this.rosterItemID_;
    }

    public void setRosterItemId(Long ID) {
	this.rosterItemID_ = ID;
    }

    public UserID getJID() {
	return this.jid_;
    }

    public void setJID(UserID jid) {
	this.jid_ = jid;
    }

}
